package com.mybar.subject.common.enums;

import lombok.Getter;

@Getter
public enum ResultCodeEnums {

    SUCCESS(200,"成功"),
    FAIL(400,"失败");

    public int code;

    public String desc;

    ResultCodeEnums(int code,String desc){
        this.code=code;
        this.desc=desc;
    }

    public static ResultCodeEnums getByCode(int codeVal){
        for (ResultCodeEnums resultCodeEnums:ResultCodeEnums.values()){
            if (resultCodeEnums.code==codeVal)
                return resultCodeEnums;
        }
        return null;
    }


}
